#include<bits/stdc++.h>
using namespace std;
const int N=405;
const int M=1e6+5;
const int f[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
const char ff[4]={'D','R','U','L'};
int n;
char a[M];
int x,y;
char b[N][N];
int sx,sy;
int ix,ax,iy,ay;
vector<char> op;
int main(){
    freopen("snake.in","r",stdin);
    freopen("snake.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    cin>>a+1;
    n=strlen(a+1);
    for(int i=1;i<=400;i+=2){
        for(int j=1;j<=400;++j){
            if((i+j-1)%3==1)b[i][j]='R';
            else b[i][j]='G';
        }
        for(int j=1;j<=400;++j){
            if((i+j-1)%3==1)b[i+1][j]='R';
            else b[i+1][j]='B';
        }
    }
    /*for(int i=1;i<=100;++i){
        for(int j=1;j<=100;++j)cout<<b[i][j];
        cout<<'\n';
    }*/
    for(int i=198;i<=400;++i){
        if(a[1]==b[200][i]){
            x=200;
            y=i;
            break;
        }
        if(a[1]=='G'&&b[200][i]=='B'){
            x=199;
            y=i;
            break;
        }
    }
    //cout<<x<<' '<<y<<'\n';
    sy=y;sx=x;
    ix=ax=x;iy=ay=y;
    for(int i=2;i<=n;++i){
        int xx=-100,yy=-100;
        op.push_back(0);
        for(int j=0;j<4;++j){
            int tx=x+f[j][0],ty=y+f[j][1];
            if(b[tx][ty]!=a[i])continue;
            if(abs(sx-xx)+abs(sy-yy)>abs(sx-tx)+abs(sy-ty)){
                xx=tx;yy=ty;
                op.back()=ff[j];
            }
        }
        x=xx;y=yy;
        ix=min(ix,x);
        iy=min(iy,y);
        ax=max(ax,x);
        ay=max(ay,y);
    }
    cout<<ax-ix+1<<' '<<ay-iy+1<<'\n';
    for(int i=ix;i<=ax;++i){
        for(int j=iy;j<=ay;++j){
            cout<<b[i][j];
        }
        cout<<'\n';
    }
    cout<<sx-ix+1<<' '<<sy-iy+1<<'\n';
    for(auto it:op)cout<<it;
    return 0;
}
